package com.chixing.day03_oop;

/**
 * 公司类
 * 封装了所有公司共有属性和方法
 *
 * 访问修饰符 public 存在的问题：
 *  1.若修改属性名，会出现其他地方需要修改 ==> 可维护性很差
 *  2.元信息( meta )被暴露 ==> 安全性低
 *
 *  解决方案:
 *      public --> private
 *      public: 由 public 修饰的属性和方法其他类都能访问
 *      private: 由 private 修饰的属性和方法，只能本类内部访问
 */
public class Company {
    private Integer companyId;
    private String companyName;
    private String companyType;
    private String companyAddress;
    private long companyTel;

    //招聘
    public void recruit(){
        System.out.println(this.companyName+" 招聘");
    }

    //查看简历
    public void viewResume(){
        System.out.println(this.companyName+" 查看简历");
    }

    public Company(Integer companyId, String companyName, String companyType, String companyAddress, long companyTel) {
        this.companyId = companyId;
        this.companyName = companyName;
        this.companyType = companyType;
        this.companyAddress = companyAddress;
        this.companyTel = companyTel;
    }

    public Company() {
    }


    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getCompanyType() {
        return companyType;
    }

    public void setCompanyType(String companyType) {
        this.companyType = companyType;
    }

    public String getCompanyAddress() {
        return companyAddress;
    }

    public void setCompanyAddress(String companyAddress) {
        this.companyAddress = companyAddress;
    }

    public long getCompanyTel() {
        return companyTel;
    }

    public void setCompanyTel(long companyTel) {
        this.companyTel = companyTel;
    }

    public Integer getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }

    @Override
    public String toString() {
        return "Company{" +
                "companyId=" + companyId +
                ", companyName='" + companyName + '\'' +
                ", companyType='" + companyType + '\'' +
                ", companyAddress='" + companyAddress + '\'' +
                ", companyTel=" + companyTel +
                '}';
    }
}
